-- CALC_INTRUDE_MONSTER_IRON_BONUS

-- 计算乱入怪铁矿奖励
-- @param user     玩家对象
return function(user)
    local layer    = DungeonM.currentLayer();
    local ret      = {};
    local ironList;
    local rank;
    local num;
    local amount;

    if layer < 25 then
        ironList = { 1102, 1104 };
    elseif layer < 50 then
        ironList = { 1102, 1104, 1106 };
    else
        ironList = { 1102, 1104, 1106, 1108 };
    end

    for i = 1 , #ironList do
        local rand  = DungeonM.getRandSeed("intrude_monster_iron");
        local ironId = ironList[i];
        rank = ItemM.query(ironId, "rank");
        if rank == 1 then
            amount = 30 + rand % 21;
        elseif rank == 2 then
            amount = 10 + rand % 21;
        elseif rank == 3 then
            amount = 5 + rand % 11;
        elseif rank == 4 then
            amount = 3 + rand % 4;
        else
            amount = 0
        end
        table.insert(ret, {1, ironId, amount})
    end

    return ret;
end
